package com.lijie.ljblog.service;


import com.lijie.ljblog.model.Climate;
import com.lijie.ljblog.model.HistoryToday;
import com.lijie.ljblog.util.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;

/**
 * @Title: ljblog_springboot
 * @Description: ()
 * @Author:lijie
 * @Version:1.1.0
 * @since 2021/11/4
 */
@Component
public interface UtilService  {
    Result<Map<String,Object>> getLocationByIP(String ip);

    Result<Map<String,Object>> getLocationByRequset(HttpServletRequest request);

    Result<Climate> getClimateByRequst(HttpServletRequest request);

    Result<Climate> getClimateByIP(String IP);


    String fileUpload(MultipartFile file,String path)throws IOException;

    Result<HistoryToday> updateHistoday();

    Result<String> getRSAPublicKey(String redisKey);

    /**
     *  获得文件下载头
     * @return
     */
    String getFileHeadPath();

    void musicUploadList(MultipartHttpServletRequest mulRequest,String path) throws IOException, Exception;

    /**
     * 网站访问量+1。并返回访问量
     * @param request
     * @return
     */
    Result<Long> webSiteVisits(HttpServletRequest request);

    /**
     * 获得bing每日图片地址
     * @return
     */
    String bingDailyImg(String day);
    /**
     * 记录网站浏览记录
     * @return
     */
    void webVisitLog(HttpServletRequest request,String type);
}
